{% extends "wagglyblog/base.html" %}

{% load i18n %}
{% load wagglyblog_extras %}
{% load markup %}
{% load comments %}

{% block content %}
    <div>
        <h2>{% blocktrans %}Blogs posted in the following categories.{% endblocktrans %}</h2>
        <dl>
          {% for category in categories %}<dt>{{ category }}</dt>
          <dd>{{ category.description }}</dd>
          {% endfor %}
        </dl>
    </div>

    {% if post_list %}
        {% for post in post_list %}{% get_free_comment_count for wagglyblog.post post.id as comment_count %}
        <div class="column1-unit">
            <h2><a href="{{ post.get_absolute_url }}">{{ post.title }}</a></h2>
            <p class="quiet">{{ post.pub_date|date:"l, d F " }} at {{ post.pub_date|date:"G:i T" }}, by
                <a href="{{ post.get_author_url }}"> {{ post.author }}</a>
            </p>
            <p class="details">{% trans "Categories" %}: {% post_category_list post.id %}
                               | {% trans "Comments" %}: <a href="{{ post.get_absolute_url }}#comments">{{ comment_count }}</a></p>
            {{ post.text|markdown|truncatewords_html:"50" }}
            <p class="incr"><a href="{{ post.get_absolute_url }}">{% trans "Read more &raquo;" %}</a></p>
        </div>
        {% endfor %}
    {% else %}
        <div class="column1-unit">
            <h2>{% trans "No Posts found" %}</h2>
        </div>
    {% endif %}

{% endblock %}
